package com.fizzkai.p2p.core.domain;

import com.fizzkai.p2p.core.util.Constants;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;

@Getter@Setter
public class Account extends BaseAccount {
    private String tradePassword;//交易密码

    private BigDecimal unReceiveInterest = Constants.ZERO;//待收利息
    private BigDecimal unReceivePrincipal = Constants.ZERO;//待收本金

    private BigDecimal unReturnAmount = Constants.ZERO;//待还金额
    private BigDecimal remainBorrowLimit = Constants.BORROW_LIMIT;//剩余授信额度
    private BigDecimal borrowLimitAmount = Constants.BORROW_LIMIT;//授信额度

    // 获取总资产, 可用金额 + 冻结金额 + 待收本金。
    // 代收利息，不计入 总资产
    public BigDecimal getTotalAmount(){
        return getUsableAmount().add(getFreezedAmount()).add(unReceivePrincipal);
    }

}
